package com.guandi.geekbrowser.primary.repository;

import com.guandi.geekbrowser.primary.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User,Long> {
    User findByNameAndPassword(String name, String password);

    User findByName(String name);

    Optional<User> findById(String id);

    Page<User> findAll(Specification<User> specification, Pageable pageable);
}
